﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using UtilLibrary;
using Entity;

namespace Biz
{
    public class DictionService
    {
        public static BizDicItemList GetTaskTypes()
        {
            BizDicItemList ret = new BizDicItemList();

            Model1Container context = DbUtil.GetDbContainer();
            var query = from dc in context.dicitems
                        join d in context.dictionaries on dc.DicId equals d.Id 
                        where d.DicName == "TaskType"
                        select dc;

            foreach (dicitem item in query)
            {
                BizDictionaryItem bizItem = new BizDictionaryItem();
                DbUtil.DataEntityToBizObjTrans(item, bizItem);

                ret.Add(bizItem);
            }

            return ret;
        }
    }
}
